package com.ikun.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ikun.entity.Attendances;
import com.ikun.entity.Users;
import com.ikun.entity.req.OwnerDto;
import com.ikun.entity.req.UserDTO;

public interface UserDao extends BaseMapper<Users> {
    Users findByUsername(@Param("username") String username);

    UserDTO findUserByName(@Param("username") String username);

    List<Users> findAllOwner();

    List<Users> findAll();

    int addUser(Users users);

    int deleteUser(@Param("userId") Integer userId);

    List<Attendances> findAllMangerAttendances(@Param("datePart") String datePart, @Param("namePart") String namePart);

    List<Users> findAllStuff();

    int countAllOwners();

    int countAllStuffs();

    List<OwnerDto> findAllOwnerDetail();

    OwnerDto findAllOwnerDetailById(@Param("id") Integer id);

    List<OwnerDto> findAllOwnerDetailByManagerId(@Param("id") Integer id);

    List<OwnerDto> findAllOwnerInfoByManagerId(@Param("id") Integer id);

    OwnerDto findAllOwnerInfoById(@Param("id") Integer id);

    int updateOwner(@Param("ownerId") String ownerId, @Param("phone") String phone, @Param("photoUrl") String photoUrl);

    List<UserDTO> findAllStaff();

    int updateInfo(@Param("id") String id, @Param("phone") String phone, @Param("password") String password);
}
